package vcp.gui.forms;

import java.awt.event.ActionListener;
import java.util.Observable;
import java.util.Observer;

import vcp.common.IView;
import vcp.gui.components.VCPPanel;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.TitledBorder;

public class CheckInSubscriberForm extends VCPPanel {
	private JTextField subIdField;
	private JTextField subCarNumField;
	private JButton btnCheckIn;
	
	public CheckInSubscriberForm() {
		setBorder(new TitledBorder(null, "Subscriber check in", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		subIdField = new JTextField();
		subIdField.setColumns(10);
		
		subCarNumField = new JTextField();
		subCarNumField.setColumns(10);
		
		JLabel lblSubscrableId = new JLabel("Subscriber id");
		
		JLabel lblCarNumber = new JLabel("Car Number");
		
		btnCheckIn = new JButton("check in");
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(12)
							.addComponent(lblSubscrableId, GroupLayout.PREFERRED_SIZE, 96, GroupLayout.PREFERRED_SIZE)
							.addGap(2)
							.addComponent(subIdField, GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(12)
							.addComponent(lblCarNumber, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)
							.addGap(22)
							.addComponent(subCarNumField, GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE))
						.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
							.addContainerGap(372, Short.MAX_VALUE)
							.addComponent(btnCheckIn, GroupLayout.PREFERRED_SIZE, 89, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap())
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(13)
							.addComponent(lblSubscrableId, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(10)
							.addComponent(subIdField, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)))
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(16)
							.addComponent(lblCarNumber, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(13)
							.addComponent(subCarNumField, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(btnCheckIn, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)
					.addGap(201))
		);
		setLayout(groupLayout);
	}

	
	
	public JTextField getSubIdField() {
		return subIdField;
	}

	public void setSubIdField(JTextField subIdField) {
		this.subIdField = subIdField;
	}

	public JTextField getSubCarNumField() {
		return subCarNumField;
	}

	public void setSubCarNumField(JTextField subCarNumField) {
		this.subCarNumField = subCarNumField;
	}

	public JButton getBtnCheackIn() {
		return btnCheckIn;
	}

	public void setBtnCheackIn(JButton btnCheackIn) {
		this.btnCheckIn = btnCheackIn;
	}
	
}
